import {BaseModel} from "../BaseModel";

export class UserClassEvents extends BaseModel{

    constructor(){
        super();
        this.symbolName = "UserClassEvents";
        this.tableName = "t_rec_user_class_events";
        this.id = '';//主键id
        this.type = '';//类型：0 - start； 1 - end
        this.relateStartId = '';//关联的事件开始id
        this.createTime = '';//时间开始时间
        this.userId = '';//时间开始时间
        this.reverse1 = '';//备用字段1
        this.reverse2 = '';//备用字段2
        this.reverse3 = '';//备用字段3
    }

    dbMapper(){
        return {
            id: 'id',
            type: 'type',
            relateStartId: 'relate_start_id',
            createTime: 'create_time',
            userId: 'user_id',
            reverse1: 'reverse1',
            reverse2: 'reverse2',
            reverse3: 'reverse3'
        }
    }

    /**
     * 输出转换
     * @param obj
     * @returns {Book}
     */
    mappingModel(obj){
        let userClassEvents = new UserClassEvents();
        userClassEvents.id = obj.id ? obj.id : ''
        userClassEvents.type = obj.type ? obj.type : ''
        userClassEvents.relateStartId = obj.relate_start_id ? obj.relate_start_id : ''
        userClassEvents.createTime = obj.create_time ? obj.create_time : ''
        userClassEvents.userId = obj.user_id ? obj.user_id : ''
        userClassEvents.reverse1 = obj.reverse1 ? obj.reverse1 : ''
        userClassEvents.reverse2 = obj.reverse2 ? obj.reverse2 : ''
        userClassEvents.reverse3 = obj.reverse3 ? obj.reverse3 : ''
        return userClassEvents;
    }

}
